#include <bits/stdc++.h>

int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    std::sort(a.begin(), a.end());
    
    std::vector< std::pair<int, int> > duelSetEffective;
    for (int i = 0; i < n; i++) {
        int size = duelSetEffective.size();
        if (size == 0 || duelSetEffective[size - 1].first != a[i]) {
            duelSetEffective.push_back(std::make_pair(a[i], 1));
        } else {
            duelSetEffective[size - 1].second++;
        }
    }
    auto duelSetLiving(duelSetEffective);

    int ptr0 = 0; // for effective set
    int ptr1 = 0; // for living set
    int duelSetSize = duelSetLiving.size();
    int numLiving = n;

    while (true) {
        while (duelSetLiving[ptr1].first >= duelSetEffective[ptr0].first) {
            ptr0++;
            if (ptr0 >= duelSetSize || ptr1 >= duelSetSize) {
                break;
            }
        }
        if (ptr0 >= duelSetSize || ptr1 >= duelSetSize) {
            break;
        }

        int temp = std::min(duelSetLiving[ptr1].second , duelSetEffective[ptr0].second);
        numLiving -= temp;
        duelSetEffective[ptr0].second -= temp;
        duelSetLiving[ptr1].second -= temp;

        if (duelSetEffective[ptr0].second == 0) {
            ptr0++;
        }
        if (duelSetLiving[ptr1].second == 0) {
            ptr1++;
        }
        if (ptr0 >= duelSetSize || ptr1 >= duelSetSize) {
            break;
        }
    }
    std::cout << numLiving << std::endl;
    return 0;
}